package com.itheima.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <h1>webSocket （1对1进行聊天） Dto</h1>
 *
 * @author <a href="515857087@qq.com">叶世铭</a>
 * @since 2022/10/28
 */
@Data
@ApiModel(value = "转化websocket接收到的message")
public class WebsocketDto implements Serializable {

    private static final long serialVersionUID = 4534735826454944008L;
    /**
     * 发送者用户id
     */
    @NotNull(message = "发送者用户id")
    @ApiModelProperty(value = "发送者用户id",required = true)
    private String sendId;

    /**
     * 接收者用户id
     */
    @NotNull(message = "接收者用户id")
    @ApiModelProperty(value = "接收者用户id",required = true)
    private String acceptId;

    /**
     * 传递内容
     */
    @Length(message = "内容最少字数{min},内容最多字数{max}",min = 1,max = 255)
    @ApiModelProperty(value = "传递内容",required = true)
    private String content;

}
